package com.example.nationmobile;

import java.io.IOException;
import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.http.entity.mime.MultipartEntity;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

import com.coe3.data.Information;

import com.coe3.datahandler.BaseActivity;
import com.coe3.datahandler.HttpConnection;
import com.coe3.datahandler.ParserXMLHandler;
import com.coe3.datahandler.ParserXMLHandler.ElementData;



import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageLoadingListener;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
import com.slidinglayer.SlidingLayer;








import android.net.ConnectivityManager;
import android.net.NetworkInfo.DetailedState;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.RelativeLayout.LayoutParams;

@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public class MainActivity extends BaseActivity implements OnClickListener,
OnItemClickListener {

	
	//==================ListView======================
		private ListView lstView;
		private ListAdapter adapter;
		private ArrayList<HashMap<String, Object>> MyArrList_home;
		private HashMap<String, Object> map_1 = new HashMap<String, Object>();
		
		private TextView txt_daytime;
		
		private View footerView;
		private RelativeLayout lay_footer;
		private	ProgressDialog mProgressDialog;
		
		
		 private ImageLoader imageLoader = ImageLoader.getInstance();
		 private DisplayImageOptions options;
		 
		 
		 //===============Tab1================
		 private ImageView img_HL,img_banner,Img_Last;
		 private TextView txt_titleHL;
		 private FrameLayout tab1,tab2,tab3,tab4;
		 private LinearLayout Lay_Tabselect;
		 private TextView txt_selectmenu;
		 private int index_load=1;
		 
		
		 
		 
		//======================SlideLayer============================================
			private SlidingLayer mSlidingLayer;
			private String mStickContainerToRightLeftOrMiddle;
			private boolean mShowShadow;
			private ImageView img_menu_slide,btn_allmenu;
			private RelativeLayout  Relay_main;
			private LinearLayout Lay_li;
			private TextView txt_email;
			private FrameLayout lay_messss,lay_call,lay_share,lay_email;
			
			private FrameLayout Lay_National,
			Lay_Politics,
			Lay_Business,
			Lay_Rate,
			Lay_StockMarket,
			Lay_Property,
			Lay_BytelineAuto,
			Lay_Auto,
			Lay_Opinion,
			Lay_Letter,
			Lay_Lifestyle,
			Lay_livinghealth,
			Lay_Eat,
			Lay_Tourism,
			Lay_Arts,
			Lay_Boxoffice,
			Lay_Music,
			Lay_Book,
			Lay_Sports,
			Lay_hangout,
			Lay_shopping,
			Lay_social_topics;

		private int[] Lay_menu={
				R.id.Lay_National,
				R.id.Lay_Politics,
				R.id.Lay_Business,
				R.id.Lay_Rate,
				R.id.Lay_StockMarket,
				R.id.Lay_Property,
				R.id.Lay_BytelineAuto,
				R.id.Lay_Auto,
				R.id.Lay_Opinion,
				R.id.Lay_Letter,
				R.id.Lay_Lifestyle,
				R.id.Lay_livinghealth,
				R.id.Lay_Eat,
				R.id.Lay_Tourism,
				R.id.Lay_Arts,
				R.id.Lay_Boxoffice,
				R.id.Lay_Music,
				R.id.Lay_Book,
				R.id.Lay_Sports,
				R.id.Lay_hangout,
				R.id.Lay_shopping,
				R.id.Lay_social_topics};
			
		
		
		
		
		private FrameLayout[] Frame_Layout={
				Lay_National,
				Lay_Politics,
				Lay_Business,
				Lay_Rate,
				Lay_StockMarket,
				Lay_Property,
				Lay_BytelineAuto,
				Lay_Auto,
				Lay_Opinion,
				Lay_Letter,
				Lay_Lifestyle,
				Lay_livinghealth,
				Lay_Eat,
				Lay_Tourism,
				Lay_Arts,
				Lay_Boxoffice,
				Lay_Music,
				Lay_Book,
				Lay_Sports,
				Lay_hangout,
				Lay_shopping,
				Lay_social_topics};
		
		//==========================================================================================================	
			
			
		
		
	private FrameLayout Img_home,Img_opinion,Img_mul,Img_favorite,Img_setting; 
		
		 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		if (android.os.Build.VERSION.SDK_INT > 9) {
			StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
					.permitAll().build();
			StrictMode.setThreadPolicy(policy);
		}
		
		Log.e("evt", "====================onCreate====================");
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
		WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.activity_main);
		
		
		
		
		
		if (lstView == null) {
			lstView = (ListView) findViewById(R.id.list_view);
			setProgressBarIndeterminateVisibility(true);
			lstView.setOnItemClickListener(this);
			 //=====================ProgressDialog==========================
	        mProgressDialog = new ProgressDialog(this);
	        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);         
	        mProgressDialog.setMessage("Loading......");                       
	        mProgressDialog.setCancelable(false);  
	        
	        
	        footerView = ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer_layout, null, false);
			lstView.addHeaderView(footerView, null, true);
			lay_footer = (RelativeLayout) footerView.findViewById(R.id.lay_footer);
			img_HL=(ImageView)lay_footer.findViewById(R.id.img_footer);
		
	        
			
		}
		if (MyArrList_home == null)
			MyArrList_home = new ArrayList<HashMap<String, Object>>();

		
		//========================img==========================
		 options = new DisplayImageOptions.Builder()
			.showStubImage(R.drawable.thumb)
			.showImageForEmptyUri(R.drawable.thumb)
			.showImageOnFail(R.drawable.thumb)
			.cacheInMemory()
			.cacheOnDisc()
			//.displayer(new RoundedBitmapDisplayer(0))
			.build();
		initImageLoader(MainActivity.this);
		
		
		
		tab1=(FrameLayout)findViewById(R.id.tab1);
		tab2=(FrameLayout)findViewById(R.id.tab2);
		tab3=(FrameLayout)findViewById(R.id.tab3);
		tab4=(FrameLayout)findViewById(R.id.tab4);
		Img_Last=(ImageView)findViewById(R.id.Img_Last);
		Img_Last.setOnClickListener(this);
		
		
		tab1.setOnClickListener(this);
		tab2.setOnClickListener(this);
		tab3.setOnClickListener(this);
		tab4.setOnClickListener(this);
		
		Lay_Tabselect=(LinearLayout)findViewById(R.id.Lay_Tabselect);
		txt_selectmenu=(TextView)findViewById(R.id.txt_selectmenu);
		

		SetTime();
		InitTab1();
		SettabSelect();
		
		
		String url=Control.url_menu[Control.current_tab];
		startConnection( url, "", HttpConnection.GET, -1, null );
		
		
		
		//==========================Slidemenu=====================

		btn_allmenu=(ImageView)findViewById(R.id.btn_allmenu);
		btn_allmenu.setOnClickListener(this);
		
		bindViews();
		getPrefs();
		initState();
		
		int i=0;
		while(i<Lay_menu.length)
		{
			
			Frame_Layout[i]=(FrameLayout)findViewById(Lay_menu[i]);
			Frame_Layout[i].setOnClickListener(this);
			i++;
		}
		//===========================================================
		
		
		//=======================Tabdown=======================
		//==============Tab====================
		Img_home=(FrameLayout)findViewById(R.id.Img_home);
		Img_opinion=(FrameLayout)findViewById(R.id.Img_opinion);
		Img_mul=(FrameLayout)findViewById(R.id.Img_mul);
		Img_favorite=(FrameLayout)findViewById(R.id.Img_favorite);
		Img_setting =(FrameLayout)findViewById(R.id.Img_setting);
				
		//Img_home.setOnClickListener(this);
		Img_opinion.setOnClickListener(this);
		Img_mul.setOnClickListener(this);
		Img_favorite.setOnClickListener(this);
		Img_setting .setOnClickListener(this);
		
		
		
	}

	private void SetTime()
	{
		
	    String resultTxt=""+DateFormat.format("MM/dd/yy , h:mmaa", System.currentTimeMillis());
		txt_daytime=(TextView)findViewById(R.id.txt_daytime);
		txt_daytime.setText(resultTxt);
	}

	private void InitTab1()
	{
			
			txt_titleHL=(TextView)lay_footer.findViewById(R.id.txt_titleHL);
			
	}
	
	
	
	@Override
	public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {
		// TODO Auto-generated method stub
		
		
		Log.e("NT", "position_list="+position+"");
		
		if(Control.current_tab==0)
		{
			Control.news_description=Control.List_description0.get(position);
			Control.news_detail=Control.List_detail0.get(position);
			Control.news_photo=Control.List_photo0.get(position);
			Control.news_title=Control.List_title0.get(position);
			Control.news_link= Control.List_link0.get(position);
			Control.news_thumbnail= Control.List_thumbnail0.get(position);
			Control.news_byline= Control.List_byline0.get(position);
			
		}
		
		else
		if(Control.current_tab==1)
		{
			Control.news_description=Control.List_description1.get(position);
			Control.news_detail=Control.List_detail1.get(position);
			Control.news_photo=Control.List_photo1.get(position);
			Control.news_title=Control.List_title1.get(position);
			Control.news_link= Control.List_link1.get(position);
			Control.news_thumbnail= Control.List_thumbnail1.get(position);
			Control.news_byline= Control.List_byline1.get(position);
			
		}
		else if(Control.current_tab==2)
		{
			Control.news_description=Control.List_description2.get(position);
			Control.news_detail=Control.List_detail2.get(position);
			Control.news_photo=Control.List_photo2.get(position);
			Control.news_title=Control.List_title2.get(position);
			Control.news_link= Control.List_link2.get(position);
			Control.news_thumbnail= Control.List_thumbnail2.get(position);
			Control.news_byline= Control.List_byline2.get(position);
		}
		else if(Control.current_tab==3)
		{
			Control.news_description=Control.List_description3.get(position);
			Control.news_detail=Control.List_detail3.get(position);
			Control.news_photo=Control.List_photo3.get(position);
			Control.news_title=Control.List_title3.get(position);
			Control.news_link= Control.List_link3.get(position);
			Control.news_thumbnail= Control.List_thumbnail3.get(position);
			Control.news_byline= Control.List_byline3.get(position);
		
		} 
		else if(Control.current_tab==4)
		{
			Control.news_description=Control.List_description4.get(position);
			Control.news_detail=Control.List_detail4.get(position);
			Control.news_photo=Control.List_photo4.get(position);
			Control.news_title=Control.List_title4.get(position);
			Control.news_link= Control.List_link4.get(position);
			Control.news_thumbnail= Control.List_thumbnail4.get(position);
			Control.news_byline= Control.List_byline4.get(position);
		}
		
		else if(Control.current_tab==5)
		{
			Control.news_description=Control.List_description5.get(position);
			Control.news_detail=Control.List_detail5.get(position);
			Control.news_photo=Control.List_photo5.get(position);
			Control.news_title=Control.List_title5.get(position);
			Control.news_link= Control.List_link5.get(position);
			Control.news_thumbnail= Control.List_thumbnail5.get(position);
			Control.news_byline= Control.List_byline5.get(position);
		}
		
		else if(Control.current_tab==6)
		{
			Control.news_description=Control.List_description6.get(position);
			Control.news_detail=Control.List_detail6.get(position);
			Control.news_photo=Control.List_photo6.get(position);
			Control.news_title=Control.List_title6.get(position);
			Control.news_link= Control.List_link6.get(position);
			Control.news_thumbnail= Control.List_thumbnail6.get(position);
			Control.news_byline= Control.List_byline6.get(position);
		}
			
		else if(Control.current_tab==7)
		{
			Control.news_description=Control.List_description7.get(position);
			Control.news_detail=Control.List_detail7.get(position);
			Control.news_photo=Control.List_photo7.get(position);
			Control.news_title=Control.List_title7.get(position);
			Control.news_link= Control.List_link7.get(position);
			Control.news_thumbnail= Control.List_thumbnail7.get(position);
			Control.news_byline= Control.List_byline7.get(position);
		}
		
		else if(Control.current_tab==8)
		{
			Control.news_description=Control.List_description8.get(position);
			Control.news_detail=Control.List_detail8.get(position);
			Control.news_photo=Control.List_photo8.get(position);
			Control.news_title=Control.List_title8.get(position);
			Control.news_link= Control.List_link8.get(position);
			Control.news_thumbnail= Control.List_thumbnail8.get(position);
			Control.news_byline= Control.List_byline8.get(position);
		}
		
		else if(Control.current_tab==9)
		{
			Control.news_description=Control.List_description9.get(position);
			Control.news_detail=Control.List_detail9.get(position);
			Control.news_photo=Control.List_photo9.get(position);
			Control.news_title=Control.List_title9.get(position);
			Control.news_link= Control.List_link9.get(position);
			Control.news_thumbnail= Control.List_thumbnail9.get(position);
			Control.news_byline= Control.List_byline9.get(position);
		}
		
		else if(Control.current_tab==10)
		{
			Control.news_description=Control.List_description10.get(position);
			Control.news_detail=Control.List_detail10.get(position);
			Control.news_photo=Control.List_photo10.get(position);
			Control.news_title=Control.List_title10.get(position);
			Control.news_link= Control.List_link10.get(position);
			Control.news_thumbnail= Control.List_thumbnail10.get(position);
			Control.news_byline= Control.List_byline10.get(position);
		}
		
		if(Control.current_tab==11)
		{
			Control.news_description=Control.List_description11.get(position);
			Control.news_detail=Control.List_detail11.get(position);
			Control.news_photo=Control.List_photo11.get(position);
			Control.news_title=Control.List_title11.get(position);
			Control.news_link= Control.List_link11.get(position);
			Control.news_thumbnail= Control.List_thumbnail11.get(position);
			Control.news_byline= Control.List_byline11.get(position);
		}
		else if(Control.current_tab==12)
		{
			Control.news_description=Control.List_description12.get(position);
			Control.news_detail=Control.List_detail12.get(position);
			Control.news_photo=Control.List_photo12.get(position);
			Control.news_title=Control.List_title12.get(position);
			Control.news_link= Control.List_link12.get(position);
			Control.news_thumbnail= Control.List_thumbnail12.get(position);
			Control.news_byline= Control.List_byline12.get(position);
		}
		else if(Control.current_tab==13)
		{
			Control.news_description=Control.List_description13.get(position);
			Control.news_detail=Control.List_detail13.get(position);
			Control.news_photo=Control.List_photo13.get(position);
			Control.news_title=Control.List_title13.get(position);
			Control.news_link= Control.List_link13.get(position);
			Control.news_thumbnail= Control.List_thumbnail13.get(position);
			Control.news_byline= Control.List_byline13.get(position);
		} 
		else if(Control.current_tab==14)
		{
			Control.news_description=Control.List_description14.get(position);
			Control.news_detail=Control.List_detail14.get(position);
			Control.news_photo=Control.List_photo14.get(position);
			Control.news_title=Control.List_title14.get(position);
			Control.news_link= Control.List_link14.get(position);
			Control.news_thumbnail= Control.List_thumbnail14.get(position);
			Control.news_byline= Control.List_byline14.get(position);
			
		}
		
		else if(Control.current_tab==15)
		{
			Control.news_description=Control.List_description15.get(position);
			Control.news_detail=Control.List_detail15.get(position);
			Control.news_photo=Control.List_photo15.get(position);
			Control.news_title=Control.List_title15.get(position);
			Control.news_link= Control.List_link15.get(position);
			Control.news_thumbnail= Control.List_thumbnail15.get(position);
			Control.news_byline= Control.List_byline15.get(position);
			
		}
		
		else if(Control.current_tab==16)
		{
			Control.news_description=Control.List_description16.get(position);
			Control.news_detail=Control.List_detail16.get(position);
			Control.news_photo=Control.List_photo16.get(position);
			Control.news_title=Control.List_title16.get(position);
			Control.news_link= Control.List_link16.get(position);
			Control.news_thumbnail= Control.List_thumbnail16.get(position);
			Control.news_byline= Control.List_byline16.get(position);
		}
			
		else if(Control.current_tab==17)
		{
			Control.news_description=Control.List_description17.get(position);
			Control.news_detail=Control.List_detail17.get(position);
			Control.news_photo=Control.List_photo17.get(position);
			Control.news_title=Control.List_title17.get(position);
			Control.news_link= Control.List_link17.get(position);
			Control.news_thumbnail= Control.List_thumbnail17.get(position);
			Control.news_byline= Control.List_byline17.get(position);
		}
		
		else if(Control.current_tab==18)
		{
			Control.news_description=Control.List_description18.get(position);
			Control.news_detail=Control.List_detail18.get(position);
			Control.news_photo=Control.List_photo18.get(position);
			Control.news_title=Control.List_title18.get(position);
			Control.news_link= Control.List_link18.get(position);
			Control.news_thumbnail= Control.List_thumbnail18.get(position);
			Control.news_byline= Control.List_byline18.get(position);
		}
		
		else if(Control.current_tab==19)
		{
			Control.news_description=Control.List_description19.get(position);
			Control.news_detail=Control.List_detail19.get(position);
			Control.news_photo=Control.List_photo19.get(position);
			Control.news_title=Control.List_title19.get(position);
			Control.news_link= Control.List_link19.get(position);
			Control.news_thumbnail= Control.List_thumbnail19.get(position);
			Control.news_byline= Control.List_byline19.get(position);
		}
		
		else if(Control.current_tab==20)
		{
			Control.news_description=Control.List_description20.get(position);
			Control.news_detail=Control.List_detail20.get(position);
			Control.news_photo=Control.List_photo20.get(position);
			Control.news_title=Control.List_title20.get(position);
			Control.news_link= Control.List_link20.get(position);
			Control.news_thumbnail= Control.List_thumbnail20.get(position);
			Control.news_byline= Control.List_byline20.get(position);
		}
		else if(Control.current_tab==21)
		{
			Control.news_description=Control.List_description21.get(position);
			Control.news_detail=Control.List_detail21.get(position);
			Control.news_photo=Control.List_photo21.get(position);
			Control.news_title=Control.List_title21.get(position);
			Control.news_link= Control.List_link21.get(position);
			Control.news_thumbnail= Control.List_thumbnail21.get(position);
			Control.news_byline= Control.List_byline21.get(position);
			
		}
		else if(Control.current_tab==22)
		{
			Control.news_description=Control.List_description22.get(position);
			Control.news_detail=Control.List_detail22.get(position);
			Control.news_photo=Control.List_photo22.get(position);
			Control.news_title=Control.List_title22.get(position);
			Control.news_link= Control.List_link22.get(position);
			Control.news_thumbnail= Control.List_thumbnail22.get(position);
			Control.news_byline= Control.List_byline22.get(position);
		}
		else if(Control.current_tab==23)
		{
			Control.news_description=Control.List_description23.get(position);
			Control.news_detail=Control.List_detail23.get(position);
			Control.news_photo=Control.List_photo23.get(position);
			Control.news_title=Control.List_title23.get(position);
			Control.news_link= Control.List_link23.get(position);
			Control.news_thumbnail= Control.List_thumbnail23.get(position);
			Control.news_byline= Control.List_byline23.get(position);
		}
		
		
		else if(Control.current_tab==24)
		{
			Control.news_description=Control.List_description24.get(position);
			Control.news_detail=Control.List_detail24.get(position);
			Control.news_photo=Control.List_photo24.get(position);
			Control.news_title=Control.List_title24.get(position);
			Control.news_link= Control.List_link24.get(position);
			Control.news_thumbnail= Control.List_thumbnail24.get(position);
			Control.news_byline= Control.List_byline24.get(position);
		}
		
		else if(Control.current_tab==25)
		{
			Control.news_description=Control.List_description25.get(position);
			Control.news_detail=Control.List_detail25.get(position);
			Control.news_photo=Control.List_photo25.get(position);
			Control.news_title=Control.List_title25.get(position);
			Control.news_link= Control.List_link25.get(position);
			Control.news_thumbnail= Control.List_thumbnail25.get(position);
			Control.news_byline= Control.List_byline26.get(position);
		}
		
		else if(Control.current_tab==26)
		{
			Control.news_description=Control.List_description26.get(position);
			Control.news_detail=Control.List_detail26.get(position);
			Control.news_photo=Control.List_photo26.get(position);
			Control.news_title=Control.List_title26.get(position);
			Control.news_link= Control.List_link26.get(position);
			Control.news_thumbnail= Control.List_thumbnail26.get(position);
			Control.news_byline= Control.List_byline26.get(position);
		}
		
		
		
		Log.e("NT", "position_list="+Control.news_photo+"");
		
		startActivityForResult(new Intent(MainActivity.this,NewsDetailActivity.class), 0);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
		
		
		if(mSlidingLayer.isOpened())
		{
			int i=0;
			while(i<Lay_menu.length)
			{
				if(v.getId()==Lay_menu[i])
				{
					
					chk_selectmenu(5+i);
					 mSlidingLayer.closeLayer(true);
				}
				i++;
			}
			
		}
	
		
		
		
		if(v.getId()==R.id.Img_Last)
		{
			

			Control.current_tab=0;
			String url=Control.url_menu[0];
			//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
			
			if(Control.List_title0.size()<1)
			{
				
				startConnection( url, "", HttpConnection.GET, -1, null );
			}else 
				ClearList_AddNewData();
			
		}
		
		
		
		if(v.getId()==R.id.tab1)
		{
			
			Control.current_tab=1;
			chk_header();
			String url=Control.url_menu[1];
			//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
			
			if(Control.List_title1.size()<1)
			{
				
				startConnection( url, "", HttpConnection.GET, -1, null );
			}
			else 
				ClearList_AddNewData();
			
		}
		
		if(v.getId()==R.id.tab2)
		{
			Control.current_tab=2;
			String url=Control.url_menu[2];
			//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
			if(Control.List_title2.size()<1)
			{
				startConnection( url, "", HttpConnection.GET, -1, null );
			}else 
				ClearList_AddNewData();
			
		}
		
		if(v.getId()==R.id.tab3)
		{
			Control.current_tab=3;
			String url=Control.url_menu[3];
			//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
			if(Control.List_title3.size()<1)
			{
				startConnection( url, "", HttpConnection.GET, -1, null );
			}else 
				ClearList_AddNewData();
		}
		
		if(v.getId()==R.id.tab4)
		{
				Control.current_tab=4;
			String url=Control.url_menu[4];
			//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
			
			if(Control.List_title4.size()<1)
			{
				startConnection( url, "", HttpConnection.GET, -1, null );
			}else 
				ClearList_AddNewData();
		}
		
		if(v.getId()==R.id.btn_allmenu)
		{
			if(!mSlidingLayer.isOpened())
			 mSlidingLayer.openLayer(true); 
			
		}
		
		
		
		
		
		
		
		
		
		
		
		
		//========================TabDown=====================
		if(v.getId()==R.id.Img_opinion)
		{

			startActivityForResult(new Intent(MainActivity.this,OpinionActivity.class), 0);
			overridePendingTransition (R.anim.fade_in, R.anim.fade_out);
		}
		if(v.getId()==R.id.Img_mul)
		{
			startActivityForResult(new Intent(MainActivity.this,MulActivity.class), 0);
			overridePendingTransition (R.anim.fade_in, R.anim.fade_out);
		}
		if(v.getId()==R.id.Img_favorite)
		{
			startActivityForResult(new Intent(MainActivity.this,FavoritesActivity.class), 0);
			overridePendingTransition (R.anim.fade_in, R.anim.fade_out);
		}
		if(v.getId()==R.id.Img_setting)
		{
			startActivityForResult(new Intent(MainActivity.this,SettingActivity.class), 0);
			overridePendingTransition (R.anim.fade_in, R.anim.fade_out);
		}
		
		chk_header();
		SettabSelect();
		
		

		runOnUiThread (new Thread(new Runnable() { 
	         public void run() {
	                adapter.notifyDataSetChanged();    
	               
	         }
	     }));
		
		
		
		
	}
	public boolean onKeyDown( int keyCode, KeyEvent event ) {

		    if ( keyCode == KeyEvent.KEYCODE_BACK ) {
		    	 Control.current_tab=1;
		    	 //ClearDataAll();
		    	 finish();
		    	
		    	
		    	return true;
		    }

		    return super.onKeyDown(keyCode, event);
		}
	 
	 
	
	private void chk_selectmenu(int menu)
	{
	
		Log.e("NT","select :"+menu);
		
		Control.current_tab=menu;
		chk_header();
		String url=Control.url_menu[menu];
		//String url="http://www.nationmultimedia.com/new/rss/ipad_v2/highlight.xml";
		
		if(menu==5)
		{
			if(Control.List_title5.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
			
			
		} else if(menu==6)
			
		{
			if(Control.List_title6.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==7)
		{
			if(Control.List_title7.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==8)
		{
			if(Control.List_title8.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==9)
		{
			if(Control.List_title9.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==10)
		{
			if(Control.List_title10.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		else if(menu==11)
		{
			if(Control.List_title11.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==12)
		{
			if(Control.List_title12.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==13)
		{
			if(Control.List_title13.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==14)
		{
			if(Control.List_title14.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==15)
		{
			if(Control.List_title15.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==16)
		{
			if(Control.List_title16.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==17)
		{
			if(Control.List_title17.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==18)
		{
			if(Control.List_title18.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==19)
		{
			if(Control.List_title19.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==20)
		{
			if(Control.List_title20.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		else if(menu==21)
		{
			if(Control.List_title21.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==22)
		{
			if(Control.List_title22.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		else if(menu==23)
		{
			if(Control.List_title23.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		else if(menu==24)
		{
			if(Control.List_title24.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		else if(menu==25)
		{
			if(Control.List_title25.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		else if(menu==26)
		{
			if(Control.List_title26.size()<1)
				startConnection( url, "", HttpConnection.GET, -1, null );
		}
		
		
		
	}
 	private void chk_header()
	{
		//===============chkheader============
				if(lstView!=null)
				{
					
					if(Control.current_tab!=1)
					{
						lstView.removeHeaderView(footerView);
						
						runOnUiThread (new Thread(new Runnable() { 
					         public void run() {
					                adapter.notifyDataSetChanged();    
					               
					         }
					     }));
					}
					else
					{
						if(lstView.getHeaderViewsCount()<1)
						lstView.addHeaderView(footerView, null, true);
						runOnUiThread (new Thread(new Runnable() { 
					         public void run() {
					                adapter.notifyDataSetChanged();    
					               
					         }
					     }));
					}
					
				}
		
	}
	private void SettabSelect()
	{
		Lay_Tabselect.setBackgroundColor(Color.parseColor(Control.Tab_select_color[Control.current_tab]));
		txt_selectmenu.setText(Control.Tab_select[Control.current_tab]);
		
		
		
		
		
	}
	private void ClearList_AddNewData()
	{
		
		if (adapter == null) {
			adapter = new ListAdapter(MainActivity.this, MyArrList_home);
			lstView.setAdapter(adapter);
		}
		MyArrList_home.clear();

		int i=0;
		
		
		if(Control.current_tab==0)
		{
			while(i<Control.List_title0.size())
			{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title0.get(i));
				map_1.put("description",Control.List_description0.get(i));
				map_1.put("thumbnail",Control.List_thumbnail0.get(i));
				map_1.put("detail",Control.List_detail0.get(i));
				map_1.put("photo", Control.List_photo0.get(i));
			
				MyArrList_home.add(map_1);	
				i++;
			}
		}
		else
		if(Control.current_tab==1)
		{
			while(i<Control.List_title1.size()-1)
			{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title1.get(i));
				map_1.put("description",Control.List_description1.get(i));
				map_1.put("thumbnail",Control.List_thumbnail1.get(i));
				map_1.put("detail",Control.List_detail1.get(i));
				map_1.put("photo", Control.List_photo1.get(i));
			
				MyArrList_home.add(map_1);	
				i++;
			}
		}
		else
			if(Control.current_tab==2)
			{
				while(i<Control.List_title2.size())
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title",Control.List_title2.get(i));
					map_1.put("description",Control.List_description2.get(i));
					map_1.put("thumbnail",Control.List_thumbnail2.get(i));
					map_1.put("detail",Control.List_detail2.get(i));
					map_1.put("photo", Control.List_photo2.get(i));
				
					MyArrList_home.add(map_1);	
					i++;
				}
			}
			else
				if(Control.current_tab==3)
				{
					while(i<Control.List_title3.size())
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title",Control.List_title3.get(i));
						map_1.put("description",Control.List_description3.get(i));
						map_1.put("thumbnail",Control.List_thumbnail3.get(i));
						map_1.put("detail",Control.List_detail3.get(i));
						map_1.put("photo", Control.List_photo3.get(i));
					
						MyArrList_home.add(map_1);	
						i++;
					}
				}
				else
					if(Control.current_tab==4)
					{
						while(i<Control.List_title4.size())
						{
							map_1 = new HashMap<String, Object>();
							map_1.put("title",Control.List_title4.get(i));
							map_1.put("description",Control.List_description4.get(i));
							map_1.put("thumbnail",Control.List_thumbnail4.get(i));
							map_1.put("detail",Control.List_detail4.get(i));
							map_1.put("photo", Control.List_photo4.get(i));
						
							MyArrList_home.add(map_1);	
							i++;
						}
					}
					else
						if(Control.current_tab==5)
						{
							while(i<Control.List_title5.size())
							{
								map_1 = new HashMap<String, Object>();
								map_1.put("title",Control.List_title5.get(i));
								map_1.put("description",Control.List_description5.get(i));
								map_1.put("thumbnail",Control.List_thumbnail5.get(i));
								map_1.put("detail",Control.List_detail5.get(i));
								map_1.put("photo", Control.List_photo5.get(i));
								MyArrList_home.add(map_1);	
								i++;
							}
						}
						else
							if(Control.current_tab==6)
							{
								while(i<Control.List_title6.size())
								{
									map_1 = new HashMap<String, Object>();
									map_1.put("title",Control.List_title6.get(i));
									map_1.put("description",Control.List_description6.get(i));
									map_1.put("thumbnail",Control.List_thumbnail6.get(i));
									map_1.put("detail",Control.List_detail6.get(i));
									map_1.put("photo", Control.List_photo6.get(i));
									MyArrList_home.add(map_1);	
									i++;
								}
							}
						else
							if(Control.current_tab==7)
								{
									while(i<Control.List_title7.size())
									{
										map_1 = new HashMap<String, Object>();
										map_1.put("title",Control.List_title7.get(i));
										map_1.put("description",Control.List_description7.get(i));
										map_1.put("thumbnail",Control.List_thumbnail7.get(i));
										map_1.put("detail",Control.List_detail7.get(i));
										map_1.put("photo", Control.List_photo7.get(i));
										MyArrList_home.add(map_1);	
										i++;
									}
								}
						else
							if(Control.current_tab==8)
								{
									while(i<Control.List_title8.size())
									{
										map_1 = new HashMap<String, Object>();
										map_1.put("title",Control.List_title8.get(i));
										map_1.put("description",Control.List_description8.get(i));
										map_1.put("thumbnail",Control.List_thumbnail8.get(i));
										map_1.put("detail",Control.List_detail8.get(i));
										map_1.put("photo", Control.List_photo8.get(i));
										MyArrList_home.add(map_1);	
										i++;
									}
								}
						else
							if(Control.current_tab==9)
								{
									while(i<Control.List_title9.size())
									{
										map_1 = new HashMap<String, Object>();
										map_1.put("title",Control.List_title9.get(i));
										map_1.put("description",Control.List_description9.get(i));
										map_1.put("thumbnail",Control.List_thumbnail9.get(i));
										map_1.put("detail",Control.List_detail9.get(i));
										map_1.put("photo", Control.List_photo9.get(i));
										MyArrList_home.add(map_1);	
										i++;
									}
								}
						else
							if(Control.current_tab==10)
								{
									while(i<Control.List_title10.size())
									{
										map_1 = new HashMap<String, Object>();
										map_1.put("title",Control.List_title10.get(i));
										map_1.put("description",Control.List_description10.get(i));
										map_1.put("thumbnail",Control.List_thumbnail10.get(i));
										map_1.put("detail",Control.List_detail10.get(i));
										map_1.put("photo", Control.List_photo10.get(i));
										MyArrList_home.add(map_1);	
										i++;
									}
								}
						else
							if(Control.current_tab==11)
							{
								while(i<Control.List_title11.size())
									{
									map_1 = new HashMap<String, Object>();
									map_1.put("title",Control.List_title11.get(i));
									map_1.put("description",Control.List_description11.get(i));
									map_1.put("thumbnail",Control.List_thumbnail11.get(i));
									map_1.put("detail",Control.List_detail11.get(i));
									map_1.put("photo", Control.List_photo11.get(i));
									MyArrList_home.add(map_1);	
									i++;
								}
							}
		
						else
							if(Control.current_tab==12)
							{
								while(i<Control.List_title12.size())
								{
								map_1 = new HashMap<String, Object>();
								map_1.put("title",Control.List_title12.get(i));
								map_1.put("description",Control.List_description12.get(i));
								map_1.put("thumbnail",Control.List_thumbnail12.get(i));
								map_1.put("detail",Control.List_detail12.get(i));
								map_1.put("photo", Control.List_photo12.get(i));
								MyArrList_home.add(map_1);	
								i++;
							}
						}
		
						else
							if(Control.current_tab==13)
						{
								while(i<Control.List_title13.size())
								{
								map_1 = new HashMap<String, Object>();
								map_1.put("title",Control.List_title13.get(i));
								map_1.put("description",Control.List_description13.get(i));
								map_1.put("thumbnail",Control.List_thumbnail13.get(i));
								map_1.put("detail",Control.List_detail13.get(i));
								map_1.put("photo", Control.List_photo13.get(i));
								MyArrList_home.add(map_1);	
								i++;
								}
						}
		
		
			if(Control.current_tab==14)
			{
				while(i<Control.List_title14.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title14.get(i));
				map_1.put("description",Control.List_description14.get(i));
				map_1.put("thumbnail",Control.List_thumbnail14.get(i));
				map_1.put("detail",Control.List_detail14.get(i));
				map_1.put("photo", Control.List_photo14.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==15)
			{
				while(i<Control.List_title15.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title15.get(i));
				map_1.put("description",Control.List_description15.get(i));
				map_1.put("thumbnail",Control.List_thumbnail15.get(i));
				map_1.put("detail",Control.List_detail15.get(i));
				map_1.put("photo", Control.List_photo15.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==16)
			{
				while(i<Control.List_title16.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title16.get(i));
				map_1.put("description",Control.List_description16.get(i));
				map_1.put("thumbnail",Control.List_thumbnail16.get(i));
				map_1.put("detail",Control.List_detail16.get(i));
				map_1.put("photo", Control.List_photo16.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==17)
			{
				while(i<Control.List_title17.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title17.get(i));
				map_1.put("description",Control.List_description17.get(i));
				map_1.put("thumbnail",Control.List_thumbnail17.get(i));
				map_1.put("detail",Control.List_detail17.get(i));
				map_1.put("photo", Control.List_photo17.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==18)
			{
				while(i<Control.List_title18.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title18.get(i));
				map_1.put("description",Control.List_description18.get(i));
				map_1.put("thumbnail",Control.List_thumbnail18.get(i));
				map_1.put("detail",Control.List_detail18.get(i));
				map_1.put("photo", Control.List_photo18.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			
			if(Control.current_tab==19)
			{
				while(i<Control.List_title19.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title19.get(i));
				map_1.put("description",Control.List_description19.get(i));
				map_1.put("thumbnail",Control.List_thumbnail19.get(i));
				map_1.put("detail",Control.List_detail19.get(i));
				map_1.put("photo", Control.List_photo19.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
		
			if(Control.current_tab==20)
			{
				while(i<Control.List_title20.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title20.get(i));
				map_1.put("description",Control.List_description20.get(i));
				map_1.put("thumbnail",Control.List_thumbnail20.get(i));
				map_1.put("detail",Control.List_detail20.get(i));
				map_1.put("photo", Control.List_photo20.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			
			if(Control.current_tab==21)
			{
				while(i<Control.List_title21.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title21.get(i));
				map_1.put("description",Control.List_description21.get(i));
				map_1.put("thumbnail",Control.List_thumbnail21.get(i));
				map_1.put("detail",Control.List_detail21.get(i));
				map_1.put("photo", Control.List_photo21.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			
			if(Control.current_tab==22)
			{
				while(i<Control.List_title22.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title22.get(i));
				map_1.put("description",Control.List_description22.get(i));
				map_1.put("thumbnail",Control.List_thumbnail22.get(i));
				map_1.put("detail",Control.List_detail22.get(i));
				map_1.put("photo", Control.List_photo22.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==23)
			{
				while(i<Control.List_title23.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title23.get(i));
				map_1.put("description",Control.List_description23.get(i));
				map_1.put("thumbnail",Control.List_thumbnail23.get(i));
				map_1.put("detail",Control.List_detail23.get(i));
				map_1.put("photo", Control.List_photo23.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			
			if(Control.current_tab==24)
			{
				while(i<Control.List_title24.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title24.get(i));
				map_1.put("description",Control.List_description24.get(i));
				map_1.put("thumbnail",Control.List_thumbnail24.get(i));
				map_1.put("detail",Control.List_detail24.get(i));
				map_1.put("photo", Control.List_photo24.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==25)
			{
				while(i<Control.List_title25.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title25.get(i));
				map_1.put("description",Control.List_description25.get(i));
				map_1.put("thumbnail",Control.List_thumbnail25.get(i));
				map_1.put("detail",Control.List_detail25.get(i));
				map_1.put("photo", Control.List_photo25.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
			if(Control.current_tab==26)
			{
				while(i<Control.List_title26.size())
				{
				map_1 = new HashMap<String, Object>();
				map_1.put("title",Control.List_title26.get(i));
				map_1.put("description",Control.List_description26.get(i));
				map_1.put("thumbnail",Control.List_thumbnail26.get(i));
				map_1.put("detail",Control.List_detail26.get(i));
				map_1.put("photo", Control.List_photo26.get(i));
				MyArrList_home.add(map_1);	
				i++;
				}
			}
			
		
		runOnUiThread (new Thread(new Runnable() { 
	         public void run() {
	                adapter.notifyDataSetChanged();    
	               
	         }
	     }));
	}

	
	//===========================Parser===============================
	@SuppressLint("HandlerLeak")
	public void startConnection( String url, String data , int method, final int handlerType, final MultipartEntity entity ) {
			Log.e("max", "MainActivity==========startConnection");
			Log.e("chud", "url: " + url);
			Log.e("chud", "data: " + data);
			
			Handler handler = new Handler() {
				@SuppressWarnings("deprecation")
				public void handleMessage(Message message) {
					switch ( message.what ) {
					case HttpConnection.DID_START:
							showDialog( DIALOG_CONNECTION_START );
						break;
					
					case HttpConnection.DID_SUCCEED:
						try {
							Log.e("chud", "(String)message.obj: " + (String)message.obj);
							startParseXMLResponse( (String)message.obj, handlerType );
							didFinishParsing();
							
						} catch ( Exception e ) {
							Log.e( "Connection Exception", "XML Pasing Excpetion : " + e );
			        		didFinishParsing();
						}
						
						break;
					
					case HttpConnection.DID_ERROR:
						Log.e( "Connection Error", "HTTP Connection did error : " + message.obj );
		        		
		        		didFinishParsing();
						break;
					}	
				}
			};

			HttpConnection connection = new HttpConnection(handler);
			if( entity != null )
				connection.setMultipartEntity( entity );
			connection.create(method, url, data);
		}

	public void startParseXMLResponse( String response, int handlerType ) throws SAXException, ParserConfigurationException, IOException {
			
			Log.e("max", "MainActivity==========startParseXMLResponse");
			SAXParserFactory spf = SAXParserFactory.newInstance();
			SAXParser sp = spf.newSAXParser();
			XMLReader xr = sp.getXMLReader();
			
			ParserXMLHandler parser = null;
			Handler handler = handlerInformation(handlerType);
			parser = new ParserXMLHandler( this, handler );
			
			StringReader sr = new StringReader(response);
			InputSource is = new InputSource(sr);
			
			xr.setContentHandler(parser);
			xr.parse(is);
		}
		
	private static Vector<NewData> mListNews = new Vector<NewData>();
	private NewData mItem = null;
	@SuppressLint("HandlerLeak")
	public Handler handlerInformation(final int handlerType) {
			
			Log.e("max", "MainActivity==========handlerInformation");
			
			Handler mHandler = new Handler() {
				public void handleMessage( Message message ) {
					ElementData data = ( ElementData )message.obj;
					switch( message.what ) {
						case ParserXMLHandler.START_DOCUMENT:
							
							mListNews.removeAllElements();
							
							break;
							
						case ParserXMLHandler.DID_START_ELEMENT:
							
							if( data.name.equalsIgnoreCase(NewData.TAG_ITEM) ) 
							{
								mItem = new NewData();
							}//end if
							
						
							
							
							break;
							
						case ParserXMLHandler.DID_FINISH_ELEMENT:
							
							if( data.name.equalsIgnoreCase(NewData.TAG_TITLE) ) 
							{
								mItem.title = Information.setData(data.value, Information.STR_EMPTY);
							} 
							
							if( data.name.equalsIgnoreCase(NewData.TAG_DESCRIPTION) ) 
							{
								mItem.description = Information.setData(data.value, Information.STR_EMPTY);
							} 
							
							if( data.name.equalsIgnoreCase(NewData.TAG_DETAIL) ) 
							{
								mItem.detail = Information.setData(data.value, Information.STR_EMPTY);
							} 
							
							else if( data.name.equalsIgnoreCase(NewData.TAG_THUMB) ) 
							{
								mItem.thumbnail = Information.setData(data.value, Information.STR_EMPTY);
							}
							
							else if( data.name.equalsIgnoreCase(NewData.TAG_PHOTO) ) 
							{
								mItem.photo = Information.setData(data.value, Information.STR_EMPTY);
							}
							else if( data.name.equalsIgnoreCase(NewData.TAG_LINK) ) 
							{
								mItem.link = Information.setData(data.value, Information.STR_EMPTY);
							}
							
							else if( data.name.equalsIgnoreCase(NewData.TAG_BYLINE) ) 
							{
								mItem.byline = Information.setData(data.value, Information.STR_EMPTY);
							}
							
							
							
							else if( data.name.equalsIgnoreCase(NewData.TAG_ITEM) ) 
							{
								mListNews.add(mItem);
								mItem = null;
							}//end if
							
							break;
							
						case ParserXMLHandler.END_DOCUMENT:
							
							setNews(mListNews);
						   
							break;
					}
				}
			};
				
			return mHandler;
		}
	public void setNews(Vector<NewData> listNews) {
			
			
			if (adapter == null) {
				adapter = new ListAdapter(MainActivity.this, MyArrList_home);
				lstView.setAdapter(adapter);
			}
			
			MyArrList_home.clear();
			
			
			Log.e("max", "MainActivity==========setNews(Vector<NewData> listNews)");
			int i=0;
			for (NewData newData : listNews) {
				
			
				
				/*Log.e("max","enclosure_url="+ newData.title);
				Log.e("max","enclosure_url="+ newData.description);
				Log.e("max","enclosure_url="+ newData.thumbnail);*/
				Log.e("max","newData.byline="+ newData.byline);
				
				if(Control.current_tab==0)
				{
					if(i>0)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
						MyArrList_home.add(map_1);	
					}	
						
						Control.List_thumbnail0.add(newData.thumbnail);
						Control.List_title0.add(newData.title);
						Control.List_detail0.add(newData.detail);
						Control.List_description0.add(newData.description);
						Control.List_photo0.add(newData.photo);
						Control.List_link0.add(newData.link);
						Control.List_byline0.add(newData.byline);
			
				}
				else
				
				if(Control.current_tab==1)
				{
					if(i>0)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
						MyArrList_home.add(map_1);	
					}	
						
						Control.List_thumbnail1.add(newData.thumbnail);
						Control.List_title1.add(newData.title);
						Control.List_detail1.add(newData.detail);
						Control.List_description1.add(newData.description);
						Control.List_photo1.add(newData.photo);
						Control.List_link1.add(newData.link);
						Control.List_byline1.add(newData.byline);
				}
				else
				if(Control.current_tab==2)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
					
					
					Control.List_thumbnail2.add(newData.thumbnail);
					Control.List_title2.add(newData.title);
					Control.List_detail2.add(newData.detail);
					Control.List_description2.add(newData.description);
					Control.List_photo2.add(newData.photo);
					Control.List_link2.add(newData.link);
					Control.List_byline2.add(newData.byline);
					
					MyArrList_home.add(map_1);	
				}
				
				else
					if(Control.current_tab==3)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
						Control.List_thumbnail3.add(newData.thumbnail);
						Control.List_title3.add(newData.title);
						Control.List_detail3.add(newData.detail);
						Control.List_description3.add(newData.description);
						Control.List_photo3.add(newData.photo);
						Control.List_link3.add(newData.link);
						
						Control.List_byline3.add(newData.byline);
						
						MyArrList_home.add(map_1);	
					}
				
					else
					if(Control.current_tab==4)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
							
						Control.List_thumbnail4.add(newData.thumbnail);
						Control.List_title4.add(newData.title);
						Control.List_detail4.add(newData.detail);
						Control.List_description4.add(newData.description);
						Control.List_photo4.add(newData.photo);
						Control.List_link4.add(newData.link);
						Control.List_byline4.add(newData.byline);
						MyArrList_home.add(map_1);	
					}
					else
					if(Control.current_tab==5)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
								
						Control.List_thumbnail5.add(newData.thumbnail);
						Control.List_title5.add(newData.title);
						Control.List_detail5.add(newData.detail);
						Control.List_description5.add(newData.description);
						Control.List_photo5.add(newData.photo);
						Control.List_link5.add(newData.link);
						Control.List_byline5.add(newData.byline);
						MyArrList_home.add(map_1);	
					}
					else
					
					if(Control.current_tab==6)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
										
						Control.List_thumbnail6.add(newData.thumbnail);
						Control.List_title6.add(newData.title);
						Control.List_detail6.add(newData.detail);
						Control.List_description6.add(newData.description);
						Control.List_photo6.add(newData.photo);
						Control.List_link6.add(newData.link);
						Control.List_byline6.add(newData.byline);
						
						
						MyArrList_home.add(map_1);	
					}
					else
					if(Control.current_tab==7)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
											
						Control.List_thumbnail7.add(newData.thumbnail);
						Control.List_title7.add(newData.title);
						Control.List_detail7.add(newData.detail);
						Control.List_description7.add(newData.description);
						Control.List_photo7.add(newData.photo);
						Control.List_link7.add(newData.link);
						Control.List_byline7.add(newData.byline);
						
						MyArrList_home.add(map_1);	
						}	
					else
					if(Control.current_tab==8)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
											
						Control.List_thumbnail8.add(newData.thumbnail);
						Control.List_title8.add(newData.title);
						Control.List_detail8.add(newData.detail);
						Control.List_description8.add(newData.description);
						Control.List_photo8.add(newData.photo);
						Control.List_link8.add(newData.link);
						Control.List_byline8.add(newData.byline);
						
						MyArrList_home.add(map_1);	
						}			
				if(Control.current_tab==9)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail9.add(newData.thumbnail);
					Control.List_title9.add(newData.title);
					Control.List_detail9.add(newData.detail);
					Control.List_description9.add(newData.description);
					Control.List_photo9.add(newData.photo);
					Control.List_link9.add(newData.link);
					Control.List_byline9.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}			
				if(Control.current_tab==10)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail10.add(newData.thumbnail);
					Control.List_title10.add(newData.title);
					Control.List_detail10.add(newData.detail);
					Control.List_description10.add(newData.description);
					Control.List_photo10.add(newData.photo);
					Control.List_link10.add(newData.link);
					Control.List_byline10.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}			
				
				if(Control.current_tab==11)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
					MyArrList_home.add(map_1);	
					
					
					Control.List_thumbnail11.add(newData.thumbnail);
					Control.List_title11.add(newData.title);
					Control.List_detail11.add(newData.detail);
					Control.List_description11.add(newData.description);
					Control.List_photo11.add(newData.photo);
					Control.List_link11.add(newData.link);
					Control.List_byline11.add(newData.byline);
					
					MyArrList_home.add(map_1);	
				}
				else
				if(Control.current_tab==12)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
					
					
					Control.List_thumbnail12.add(newData.thumbnail);
					Control.List_title12.add(newData.title);
					Control.List_detail12.add(newData.detail);
					Control.List_description12.add(newData.description);
					Control.List_photo12.add(newData.photo);
					Control.List_link12.add(newData.link);
					Control.List_byline12.add(newData.byline);
					
					
					MyArrList_home.add(map_1);	
				}
				
				else
					if(Control.current_tab==13)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
						Control.List_thumbnail13.add(newData.thumbnail);
						Control.List_title13.add(newData.title);
						Control.List_detail13.add(newData.detail);
						Control.List_description13.add(newData.description);
						Control.List_photo13.add(newData.photo);
						Control.List_link13.add(newData.link);
						Control.List_byline13.add(newData.byline);
					
						MyArrList_home.add(map_1);	
					}
				
					else
					if(Control.current_tab==14)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
							
						Control.List_thumbnail14.add(newData.thumbnail);
						Control.List_title14.add(newData.title);
						Control.List_detail14.add(newData.detail);
						Control.List_description14.add(newData.description);
						Control.List_photo14.add(newData.photo);
						Control.List_link14.add(newData.link);
						Control.List_byline14.add(newData.byline);
						
						MyArrList_home.add(map_1);	
					}
					
					else
					if(Control.current_tab==15)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
									
						Control.List_thumbnail15.add(newData.thumbnail);
						Control.List_title15.add(newData.title);
						Control.List_detail15.add(newData.detail);
						Control.List_description15.add(newData.description);
						Control.List_photo15.add(newData.photo);
						Control.List_link15.add(newData.link);
						Control.List_byline5.add(newData.byline);
						
						
						MyArrList_home.add(map_1);	
					}else
					if(Control.current_tab==16)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
										
						Control.List_thumbnail16.add(newData.thumbnail);
						Control.List_title16.add(newData.title);
						Control.List_detail16.add(newData.detail);
						Control.List_description16.add(newData.description);
						Control.List_photo16.add(newData.photo);
						Control.List_link16.add(newData.link);
						Control.List_byline16.add(newData.byline);
						
						MyArrList_home.add(map_1);	
					}
					else
					if(Control.current_tab==17)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
											
						Control.List_thumbnail17.add(newData.thumbnail);
						Control.List_title17.add(newData.title);
						Control.List_detail17.add(newData.detail);
						Control.List_description17.add(newData.description);
						Control.List_photo17.add(newData.photo);
						Control.List_link17.add(newData.link);
						Control.List_byline17.add(newData.byline);
						
						MyArrList_home.add(map_1);	
						}	
					else
					if(Control.current_tab==18)
					{
						map_1 = new HashMap<String, Object>();
						map_1.put("title", newData.title);
						map_1.put("description", newData.description);
						map_1.put("thumbnail", newData.thumbnail);
						map_1.put("detail", newData.detail);
						map_1.put("photo", newData.photo);
											
						Control.List_thumbnail18.add(newData.thumbnail);
						Control.List_title18.add(newData.title);
						Control.List_detail18.add(newData.detail);
						Control.List_description18.add(newData.description);
						Control.List_photo18.add(newData.photo);
						Control.List_link18.add(newData.link);
						Control.List_byline18.add(newData.byline);
						
						MyArrList_home.add(map_1);	
						}			
				if(Control.current_tab==19)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail19.add(newData.thumbnail);
					Control.List_title19.add(newData.title);
					Control.List_detail19.add(newData.detail);
					Control.List_description19.add(newData.description);
					Control.List_photo19.add(newData.photo);
					Control.List_link19.add(newData.link);
					Control.List_byline19.add(newData.byline);
					
					
					MyArrList_home.add(map_1);	
					}			
				if(Control.current_tab==20)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail20.add(newData.thumbnail);
					Control.List_title20.add(newData.title);
					Control.List_detail20.add(newData.detail);
					Control.List_description20.add(newData.description);
					Control.List_photo20.add(newData.photo);
					Control.List_link20.add(newData.link);
					Control.List_byline20.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}	
				if(Control.current_tab==21)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail21.add(newData.thumbnail);
					Control.List_title21.add(newData.title);
					Control.List_detail21.add(newData.detail);
					Control.List_description21.add(newData.description);
					Control.List_photo21.add(newData.photo);
					Control.List_link21.add(newData.link);
					Control.List_byline21.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				if(Control.current_tab==22)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail22.add(newData.thumbnail);
					Control.List_title22.add(newData.title);
					Control.List_detail22.add(newData.detail);
					Control.List_description22.add(newData.description);
					Control.List_photo22.add(newData.photo);
					Control.List_link22.add(newData.link);
					Control.List_byline22.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				if(Control.current_tab==23)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail23.add(newData.thumbnail);
					Control.List_title23.add(newData.title);
					Control.List_detail23.add(newData.detail);
					Control.List_description23.add(newData.description);
					Control.List_photo23.add(newData.photo);
					Control.List_link23.add(newData.link);
					Control.List_byline23.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				if(Control.current_tab==24)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail24.add(newData.thumbnail);
					Control.List_title24.add(newData.title);
					Control.List_detail24.add(newData.detail);
					Control.List_description24.add(newData.description);
					Control.List_photo24.add(newData.photo);
					Control.List_link24.add(newData.link);
					Control.List_byline24.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				if(Control.current_tab==25)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail25.add(newData.thumbnail);
					Control.List_title25.add(newData.title);
					Control.List_detail25.add(newData.detail);
					Control.List_description25.add(newData.description);
					Control.List_photo25.add(newData.photo);
					Control.List_link25.add(newData.link);
					Control.List_byline25.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				
				if(Control.current_tab==26)
				{
					map_1 = new HashMap<String, Object>();
					map_1.put("title", newData.title);
					map_1.put("description", newData.description);
					map_1.put("thumbnail", newData.thumbnail);
					map_1.put("detail", newData.detail);
					map_1.put("photo", newData.photo);
										
					Control.List_thumbnail26.add(newData.thumbnail);
					Control.List_title26.add(newData.title);
					Control.List_detail26.add(newData.detail);
					Control.List_description26.add(newData.description);
					Control.List_photo26.add(newData.photo);
					Control.List_link26.add(newData.link);
					Control.List_byline26.add(newData.byline);
					
					MyArrList_home.add(map_1);	
					}
				
				
				
				
				
					
				if(i==0&&Control.current_tab==1)
				{
				
					imageLoader.displayImage(Control.List_photo1.get(0), img_HL, options, null);
					txt_titleHL.setText(Control.List_title1.get(0));
				}
				
				i++;
			}
			
			
			
			
			
				
					runOnUiThread (new Thread(new Runnable() { 
			         public void run() {
			                adapter.notifyDataSetChanged();    
			               
			         }
			     }));
				 
				 

					WebView WebViw = (WebView) findViewById(R.id.banner);
					WebViw.getSettings().setJavaScriptEnabled(true);
					WebViw.loadUrl(Control.Urlbanner);;
					
			
			
			
		}
		
		
		
	
	
	
	 private boolean checkInternetConnection() {
		ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		if (conMgr.getActiveNetworkInfo() != null
				&& conMgr.getActiveNetworkInfo().isAvailable()
				&& conMgr.getActiveNetworkInfo().isConnected()) {
			return true;
		} else {
			
			return false;
		}

	}
	 public static void initImageLoader(Context context) {
	  		// This configuration tuning is custom. You can tune every option, you may tune some of them, 
	  		// or you can create default configuration by
	  		//  ImageLoaderConfiguration.createDefault(this);
	  		// method.
	  		ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
			  		.memoryCacheExtraOptions(600, 800) // default = device screen dimensions
			        .threadPoolSize(3) // default
			        .threadPriority(Thread.NORM_PRIORITY - 1) // default
			        .tasksProcessingOrder(QueueProcessingType.FIFO) // default
			        .denyCacheImageMultipleSizesInMemory()
			        .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
			        .memoryCacheSize(2 * 1024 * 1024)
			        .discCacheSize(50 * 1024 * 1024)
			        .discCacheFileCount(100)
			        .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
			        .imageDownloader(new BaseImageDownloader(context)) // default
			        .imageDecoder(new BaseImageDecoder()) // default
			        //.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
			        .build();
	  		// Initialize ImageLoader with configuration.
	  		ImageLoader.getInstance().init(config);
	  	}
 
	 
	 
	 //==============================Selidemenu========================
	 private void bindViews() {
	        mSlidingLayer = (SlidingLayer) findViewById(R.id.slidingLayer1);
	        //swipeText = (TextView) findViewById(R.id.swipeText);
	        
	        
	    }
 
	 private void getPrefs() {
	        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
	        mStickContainerToRightLeftOrMiddle = prefs.getString("layer_location", "right");
	        mShowShadow = prefs.getBoolean("layer_has_shadow", false);
	        //===================================================================================
	      
	      
	        
	    }
 
	 private void initState() {

	        // Sticks container to right or left
	        LayoutParams rlp = (LayoutParams) mSlidingLayer.getLayoutParams();
	       

	        if (mStickContainerToRightLeftOrMiddle.equals("right")) {
	           // textResource = R.string.swipe_right_label;
	           // d = getResources().getDrawable(R.drawable.container_rocket_right);

	            rlp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	        } else if (mStickContainerToRightLeftOrMiddle.equals("left")) {
	            //textResource = R.string.swipe_left_label;
	            //d = getResources().getDrawable(R.drawable.container_rocket_left);

	            rlp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
	        } else {
	            //textResource = R.string.swipe_label;
	           // d = getResources().getDrawable(R.drawable.container_rocket);

	            rlp.addRule(RelativeLayout.CENTER_IN_PARENT);
	            rlp.width = LayoutParams.MATCH_PARENT;
	        }

	        //d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
	        //swipeText.setCompoundDrawables(null, d, null, null);
	        //swipeText.setText(getResources().getString(textResource));
	        mSlidingLayer.setLayoutParams(rlp);

	        // Sets the shadow of the container
	       /* if (mShowShadow) {
	            mSlidingLayer.setShadowWidthRes(R.dimen.shadow_width);
	            mSlidingLayer.setShadowDrawable(R.drawable.sidebar_shadow);
	        } else {
	            mSlidingLayer.setShadowWidth(0);
	            mSlidingLayer.setShadowDrawable(null);
	        }*/
	        
	        //==========================================================================================
	        
	     
	        
	        
	    }

	
	 private void ClearDataAll()
	 {
		    Control.news_title="";
		    Control.news_description="";
		    Control.news_detail="";
		    Control.news_photo="";
		    
		    
		    Control.List_title0.clear();
		    Control.List_title1.clear();
		    Control.List_title2.clear();
		    Control.List_title3.clear();
		    Control.List_title4.clear();
		    Control.List_title5.clear();
		    Control.List_title6.clear();
		    Control.List_title7.clear();
		    Control.List_title8.clear();
		    Control.List_title9.clear();
		    Control.List_title10.clear();
		    Control.List_title11.clear();
		    Control.List_title12.clear();
		    Control.List_title13.clear();
		    Control.List_title14.clear();
		    Control.List_title15.clear();
		    Control.List_title16.clear();
		    Control.List_title17.clear();
		    Control.List_title18.clear();
		    Control.List_title19.clear();
		    Control.List_title20.clear();
		    Control.List_title21.clear();
		    Control.List_title22.clear();
		    Control.List_title23.clear();
		    Control.List_title_Opinoin.clear();
		    
		    Control.List_detail0.clear();
		    Control.List_detail1.clear();
		    Control.List_detail2.clear();
		    Control.List_detail3.clear();
		    Control.List_detail4.clear();
		    Control.List_detail5.clear();
		    Control.List_detail6.clear();
		    Control.List_detail7.clear();
		    Control.List_detail8.clear();
		    Control.List_detail9.clear();
		    Control.List_detail10.clear();
		    Control.List_detail11.clear();
		    Control.List_detail12.clear();
		    Control.List_detail13.clear();
		    Control.List_detail14.clear();
		    Control.List_detail15.clear();
		    Control.List_detail16.clear();
		    Control.List_detail17.clear();
		    Control.List_detail18.clear();
		    Control.List_detail19.clear();
		    Control.List_detail20.clear();
		    Control.List_detail21.clear();
		    Control.List_detail22.clear();
		    Control.List_detail23.clear();
		    Control.List_detail_Opinoin.clear();
		    
		    
		    Control.List_thumbnail0.clear();
		    Control.List_thumbnail1.clear();
		    Control.List_thumbnail3.clear();
		    Control.List_thumbnail2.clear();
		    Control.List_thumbnail4.clear();
		    Control.List_thumbnail5.clear();
		    Control.List_thumbnail6.clear();
		    Control.List_thumbnail7.clear();
		    Control.List_thumbnail8.clear();
		    Control.List_thumbnail9.clear();
		    Control.List_thumbnail10.clear();
		    Control.List_thumbnail11.clear();
		    Control.List_thumbnail12.clear();
		    Control.List_thumbnail13.clear();
		    Control.List_thumbnail14.clear();
		    Control.List_thumbnail15.clear();
		    Control.List_thumbnail16.clear();
		    Control.List_thumbnail17.clear();
		    Control.List_thumbnail18.clear();
		    Control.List_thumbnail19.clear();
		    Control.List_thumbnail20.clear();
		    Control.List_thumbnail21.clear();
		    Control.List_thumbnail22.clear();
		    Control.List_thumbnail23.clear();
		    Control.List_thumbnail_Opinoin.clear();
		   
		    
		    Control.List_description0.clear();
		    Control.List_description1.clear();
		    Control.List_description2.clear();
		    Control.List_description3.clear();
		    Control.List_description4.clear();
		    Control.List_description5.clear();
		    Control.List_description6.clear();
		    Control.List_description7.clear();
		    Control.List_description8.clear();
		    Control.List_description9.clear();
		    Control.List_description10.clear();
		    Control.List_description11.clear();
		    Control.List_description12.clear();
		    Control.List_description13.clear();
		    Control.List_description14.clear();
		    Control.List_description15.clear();
		    Control.List_description16.clear();
		    Control.List_description17.clear();
		    Control.List_description18.clear();
		    Control.List_description19.clear();
		    Control.List_description20.clear();
		    Control.List_description21.clear();
		    Control.List_description22.clear();
		    Control.List_description23.clear();
		    Control.List_description_Opinoin.clear();
		    
		    
		    Control.List_photo0.clear();
		    Control.List_photo1.clear();
		    Control.List_photo2.clear();
		    Control.List_photo3.clear();
		    Control.List_photo4.clear();
		    Control.List_photo5.clear();
		    Control.List_photo6.clear();
		    Control.List_photo7.clear();
		    Control.List_photo8.clear();
		    Control.List_photo9.clear();
		    Control.List_photo10.clear();
		    Control.List_photo11.clear();
		    Control.List_photo12.clear();
		    Control.List_photo13.clear();
		    Control.List_photo14.clear();
		    Control.List_photo15.clear();
		    Control.List_photo16.clear();
		    Control.List_photo17.clear();
		    Control.List_photo18.clear();
		    Control.List_photo19.clear();
		    Control.List_photo20.clear();
		    Control.List_photo21.clear();
		    Control.List_photo22.clear();
		    Control.List_photo23.clear();
		    Control.List_photo_Opinoin.clear();
		    
	 }
	
	 @Override
	protected void onStop() {
		// TODO Auto-generated method stub
		
		//ClearDataAll();
		
		super.onStop();
	}
	
}
